package com.songlanyun.modules.integralrecord.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.enums.BillConstant;
import com.songlanyun.common.enums.IntegralConstant;
import com.songlanyun.common.enums.OpusConstant;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.modules.integralrecord.entity.IntegralRecord;
import com.songlanyun.modules.integralrecord.model.dto.SaveIntegralDTO;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 会员积分的收支记录
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-02-25 15:52:20
 */
public interface IntegralRecordService extends IService<IntegralRecord> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 积分支出
     */
    void outer(Long userId, BigDecimal value, IntegralConstant.OuterMode mode,
               IntegralConstant.IntegralModelType modelType, Long modelId, String remark);

    /**
     * 积分支出
     */
    void outer(IntegralRecord record);

    /**
     * 积分收入
     */
    void inner(IntegralRecord record);


    Boolean exists(OpusConstant.ModelType opus, Long modelId, Long userId, IntegralConstant.InnerMode mode);
}

